package com.itheima02;

import com.domain.Student;

/**
 * @author Xiao
 * @date 2021/7/6
 */
public class ArrayListDemo01 {
    /*
        对象数组
            将（张三，23）（李四，24）（王五，25）封装为3个学生对象，并存入数组中
            随后遍历数组，将学生信息输出在控制台
     */
    public static void main(String[] args) {
        Student stu1 = new Student("张三", 23);
        Student stu2 = new Student("李四", 24);
        Student stu3 = new Student("王五", 25);
        Student[] arr = {stu1, stu2, stu3};
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i].getName() + "\t" + arr[i].getAge());
        }
    }
}
